package Experiment3Test;

import Experiment3.Teacher;
import Experiment3.Course;
import Experiment3.Student;

public class TestSystem {
    public static void main(String[] args) {
        System.out.println("=== 基于继承关系的学生选课模拟系统 ===\n");

        // 创建教师
        Teacher t1 = new Teacher("T001", "张老师", "男");
        Teacher t2 = new Teacher("T002", "李老师", "女");

        // 创建课程
        Course c1 = new Course("C001", "Java程序设计", "教学楼A101", "周一 8:00-10:00", "T001");
        Course c2 = new Course("C002", "数据库原理", "教学楼B205", "周三 10:00-12:00", "T001");
        Course c3 = new Course("C003", "Web开发技术", "实验楼301", "周五 14:00-16:00", "T002");

        // 教师开课
        t1.openCourse(c1);
        t1.openCourse(c2);
        t2.openCourse(c3);

        System.out.println();

        // 创建学生
        Student s1 = new Student("S001", "小明", "男");
        Student s2 = new Student("S002", "小红", "女");

        // 使用 getId() 而不是 getStudentId()
        System.out.println("=== 基本信息 ===");
        System.out.println("学生: " + s1.getName() + " (ID: " + s1.getId() + ")");  // 改为 getId()
        System.out.println("学生: " + s2.getName() + " (ID: " + s2.getId() + ")");  // 改为 getId()
        System.out.println("教师: " + t1.getName() + " (ID: " + t1.getId() + ")");
        System.out.println("教师: " + t2.getName() + " (ID: " + t2.getId() + ")");

        System.out.println();

        // 学生选课
        s1.selectCourse(c1);
        s1.selectCourse(c2);
        s1.selectCourse(c3);
        s2.selectCourse(c1);
        s2.selectCourse(c3);

        System.out.println();

        // 打印课表
        s1.printSchedule();
        s2.printSchedule();
        t1.printSchedule();
        t2.printSchedule();

        System.out.println();

        // 测试退课功能
        System.out.println("=== 退课测试 ===");
        s1.dropCourse(c2);
        s1.printSchedule();
    }
}